<?php

namespace Compta\FormsBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Compta\FormsBundle\Entity\Category
 */
class Category
{
    /**
     * @var integer $id
     */
    private $id;

    /**
     * @var string $name
     */
    private $name;


    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set name
     *
     * @param string $name
     */
    public function setName($name)
    {
        $this->name = $name;
    }

    /**
     * Get name
     *
     * @return string 
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * @var Compta\FormsBundle\Entity\Transaction
     */
    private $transactions;

    public function __construct()
    {
        $this->transactions = new \Doctrine\Common\Collections\ArrayCollection();
    }
    
    /**
     * Add transactions
     *
     * @param Compta\FormsBundle\Entity\Transaction $transactions
     */
    public function addTransaction(\Compta\FormsBundle\Entity\Transaction $transactions)
    {
        $this->transactions[] = $transactions;
    }

    /**
     * Get transactions
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getTransactions()
    {
        return $this->transactions;
    }
    
    public function __toString()
    {
        return $this->getName();
    }
}